refactor(routers): remove DiracHttpResponseError and simplify OAuth pending response handling#988
refactor(routers): remove DiracHttpResponseError and simplify OAuth pending response handling#988mmascher wants to merge 7 commits into
Conversation
* move DiracHttpResponseError from core exceptions to diracx-routers * update imports in router factory and auth token router * keep app-level custom exception handling behavior unchanged * document error-boundary/fallback intent in coding conventions * normalize remaining e.args[0] usage to str(e) for consistency
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
aldbr
left a comment
There was a problem hiding this comment.
Thanks a lot for your PR!
The documentation looks reasonable. I just a few comments.
Note: the changes you made, or my suggestions, are breaking changes, because extensions could, in theory, already rely on these DiracHttpResponseError and DiracError.
In practice, only LHCb is running an extension in production as of now so it should be ok. We would just need to double check on our side + ask other VOs running diracx extensions in certification if they are already relying on the exceptions.
|
@aldbr I didn't realize moving Leaving it in Let's make sure my very first contribution is safe and doesn't break extensions or upset people. 😄 |
Remove local ignored file Co-authored-by: aldbr <aldbr@outlook.com>
* return JSONResponse directly for authorization_pending
…ponse in token flow
|
@aldbr I think I am done here, I added commits as a reference and then solved the various threads. |
|
FYI, the test is failing because of disk space: https://github.com/DIRACGrid/diracx/actions/runs/29428374798/job/87396639449?pr=988#step:8:223 |
Summary
This PR updates the auth error-handling approach in routers by removing DiracHttpResponseError and handling the OAuth pending-authorization response directly in the token route.
What changed
Why
The custom exception class became a one-off indirection with little value: